@extends('admin.layouts.base')

@section('css')
    <style>.form-group{margin-bottom: 0;}.m-b{margin-bottom: 0;}</style>
@stop
@section('content')
    @include('admin.site._top')
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{trans('site.base_config')}}</h5>
                    </div>
                    @include('admin.partials.success')
                    @include('admin.partials.errors')
                    <div class="ibox-content">
                        <form method="POST" action="{{url('admin/site/index')}}" class="form-horizontal">
                            {{ csrf_field() }}
                            <input type="hidden" name="group_id" value="1">
                            <input type="hidden" name="jumpUrl" value="admin/site/index">
                            {{--系统配置--}}
                            @foreach( $data['site_config'] as $row)
                                @if($row->var_key == 'seo_description')
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">{{trans("site.$row->var_key")}}：</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b">
                                                <textarea name="{{$row->var_key}}" class="form-control">{{$row->var_value}}</textarea>
                                                <span class="input-group-addon">{{$row->var_key}}</span>
                                            </div>
                                        </div>
                                    </div>
                                @else
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">{{trans("site.$row->var_key")}}：</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b">
                                                <input type="text" name="{{$row->var_key}}" value="{{$row->var_value}}" class="form-control">
                                                <span class="input-group-addon">{{$row->var_key}}</span>
                                            </div>
                                        </div>
                                    </div>
                                @endif
                            @endforeach
                            <div class="hr-line-dashed"></div>
                            {{--用户配置--}}
                            @foreach($data['custom_config'] as $rows)
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">{{$rows->var_info}}：</label>
                                    <div class="col-sm-8">
                                        <div class="input-group m-b">
                                            <input type="text" name="{{$rows->var_key}}" value="{{$rows->var_value}}" class="form-control">
                                            <span class="input-group-addon">{{$rows->var_key}}</span>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-white" type="reset">Cancel</button>
                                    <button class="btn btn-primary" type="submit">Submit</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection